home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / tcp / mufs_telnetd.lha / telnetd2_0.lha / telnetd-2.0 / source / fakesr / fakesr.h < prev    next >
C/C++ Source or Header  |  1995-01-15  |  1KB  |  41 lines

  1. /* Unit definitions */
  2. #define FSR_CTLUNIT (-1)
  3. #define FSR_UNITNONE (-1)
  4. #define MAXRESERVEDUNIT 15 /*200*/
  5.  
  6. /* Generally, if you want to request ownership of a specific arbitrary unit, 
  7.    pick a number under MAXRESERVEDUNIT. The device will randomly hand out
  8.      unused unit positions over MAXRESERVEDUNIT */
  9.  
  10. struct FSRUnit {
  11.     struct Node fsru_Node; /* fakesr private */
  12.     ULONG fsru_Num;
  13.     ULONG (*fsru_BeginIO)(void *IORequest);
  14.     ULONG (*fsru_AbortIO)(void *IORequest);
  15.     ULONG (*fsru_Open)(void *IORequest); /* called on unit OpenDevice */
  16.     ULONG (*fsru_Close)(void *IORequest); /* called on unit CloseDevice */
  17.     void *fsru_UserData[5];
  18. };
  19.  
  20. /* for FSR_CTLUNIT access, you MUST use a struct IOStdReq */
  21. /* by convention you should use a struct IOExtSer for all
  22. other unit accesses, although it is not required, if the 
  23. unit's owner supports other structures */
  24.  
  25. /* extended commands for FSR_CTLUNIT */
  26. #define FSRCMD_ADDUNIT (CMD_NONSTD+1)
  27. /* for FSRCMD_ADDUNIT set Unit->fsru_Num equal to the desired unit number,
  28. or FSR_UNITNONE if you don't care. set io_Data to a pointer to your
  29. struct FSRUnit. */
  30.  
  31.  
  32. #define FSRCMD_REMUNIT (CMD_NONSTD+2) 
  33. /* set io_Data to a pointer to the FSRUnit you want to remove */
  34.  
  35. /* fakesr FSR_CTLUNIT DOES NOT support control commands sent 
  36.    from interrupt code. Don't try it.
  37.      HOWEVER: Individual units may support such accesses */
  38.  
  39. /* Errors */
  40. #define FSRCTLERR_NONUNIQUE 1 /* possible error return from FSR_CTLUNIT */
  41.